xp required: 34bb0-cf
current health: 03c1;	03c0 max hp
e.g. 1b2d1 in ROM stored at b2c1 in RAM. 16 bit value minus $10 (16) byte header

Level to hit gets bitwise AND'ed by 0x1F to give the level needed (so lowest 5 bits)
monster dies when HP goes below 0

34be2-7 sword attack; 34be8-ec sword lvl 3 mp cost (8->4,16->8,16->8,40->20); 34bb0-cf exp to next lvl (2 bytes per lvl); 
34bee-c03 gold drop table: 0000; 0001->2; 0002->4; 0004->8; 0008->16; 0016->32; 0030->60; 0050->125; 100->250; 200=>500; 400->1000;
	for minibosses 50->125; 100->250; 200->500; 400->1000; 500 (dropped by mimic)

~C305 executes loading of atk values upon scene change, projectile spawn, and your weapon atk values when you attack
addresses for atk values; hp value -1; def +2; lvl to hit/status effects +3; projectile type/pattern +4; AI pattern +7;
gold drop rank/resistances +11 $B; xp value +12 $C (xp values over 128 are multiplied by 16)
+11 gold drop rank higher 4 bits, resistances lower 4 bits	bit 3 thunder res, bit 2 water res, bit 1 fire res, bit 0 wind res,   (bit set if resistant)
+3 status effect bits	bit 7 poison touch, bit 6 wider hitbox?, bit 5 paralysis immunity


1b2b9 b2a9 blue jelly		1gp->2 1xp->3: 1b2c5
1b2d1 b2c1 weretiger 		2gp->4 1xp->3: 1b2dd
1b2e9 b2d9 green slime		2gp->4 2xp->6: 1b2f5
1b300 b2f0 red jelly		2gp->4 2xp->6: 1b30c
1b318 b308 earth golem		4gp->8 4xp->12: 1b324
1b347 b337 green wyvern		4gp->8 3xp->9: 1b353
1b35f b34f cave vampire boss	10xp->30: 1b36b	lvl 1
1b377 b367 wereboar		4gp->8 5xp->15: 1b383
1b3a8 b398 blue shroom 		4gp->8 8xp->24: 1b3b4
1b41c b40c big blue jelly	4gp->8 6xp->18: 1b428
1b3bf b3af roly-poly 		4gp->8 8xp->24: 1b3cb 
1b3ee b3de dandelion puff	0gp 6xp->18: 1b3fa
1b390 b380 flying rolypoly	4gp->8 8xp->24: 1b39c
1b405 b3f5 bug boss		50xp: 1b411 lvl 1
1b435 b425 abominable snowman	8gp->16 12xp->30: 1b441 21hp. 6def->3
1b44e b43e rock crawler 	8gp->16 8xp->24: 1b45a
1b47c b46c red wyvern 		8gp->16 10xp->30: 1b488
1b465 b455 cyclops spider 	8gp->16 8xp->24: 1b471
1b4f5 b4e5 kelbesque		100xp->304: 1b501 atk 46->38 rock attack 1bb0c lvl 1
1b494 b484 dragonian soldier	8gp->16 25xp->75: 1b4a0 def 6->4  touch atk 48->32  sword atk 1bd21 40->32  water resistance stripped: 46->42
1b4c6 b4b6 red rock crawler	8gp->16 15xp->45: 1b4d2
1b4af b49f blue roper		8gp->16 15xp->45: 1b4bb
1b4dd b4cd ice golem 		8gp->16 35xp->105: 1b4e9
1b525 b515 plains yeti 		16gp->32 25xp->75: 1b531 atk 44->38 hatchet 1bd4b 45->40
1b53e b52e red slime		16gp->32 22xp->66: 1b54a
1b584 b574 flying red spinner 	16gp->32 40xp->120: 1b590 atk 50->35
1b56d b55d red cave crab	16gp->32 30xp->90: 1b579
1b5f0 b5e0 mimic		500gp 126xp: 1b5fc
1b555 b545 medusa 		50gp->125 50xp->128: 1b561
1b59b b58b harpy-bats		30gp->60 60xp->144: 1b5a7
1b60a b5fa red spider		30gp->60 120xp->304: 1b616
1b5d9 b5c9 purple roper		30gp->60 100xp->256: 1b5e5
	   purple wyvern	(red wyvern stats)
1b5c2 b5b2 purple shroom	30gp->60 80xp->192: 1b5ce
1b3d6 b3c6 puff flying rolypoly	71atk->42 8gp->16 592xp->192: 1b3e2
1b623 b613 merman		50gp->125 144xp->360: 1b62f
1b653 b643 octopus 		100gp->250 176xp->440: 1b65f
1b63c b62c water slime		30gp->60 160xp->400: 1b648
	   red shroom		(purple shroom stats)
1b66a b65a green wyvern 	50gp->125 176xp->448: 1b676
	   flying blue spinner	(flying red spinner stats)
1b69a b68a invisible mage	(can be revealed but not killed)
1b6b0 b6a0 revealed mage	100gp->250 256xp->640: 1b6bc
1b6cd b6bd purple moth		0gp 208xp->528: 1b6d9
1b6e4 b6d4 sabera		800xp->2000: 1b6f0 lvl 1
1b683 b673 sand mudman		50gp->125 208xp->528 : 1b68f
1b71d b70d dragonian archers	100gp->250 256xp->640: 1b729
1b736 b726 spitting harpy	50gp->125 288xp->720: 1b742	1bc2b spit attack 32dmg
1b764 b754 flail soldier	100gp->250 320xp->800: 1b770
1b74d b73d lava ooze		100gp->250 304xp->768: 1b759
1b77d b76d beholder		50gp->125 272xp->688 : 1b789
1b7ae b79e guard mage		100gp->250 672xp->1680: 1b7ba lvl 1
1b795 b785 salamander		200gp->500 608xp->1520: 1b7a1
1b7c6 mado? 			1008xp->2032: 1b7d2 lvl 1
1b7f8 b7e8 hellbat		100gp->250 672xp->1680: 1b804
1b7df b7cf sword-throwing grunt 100gp->250 560xp->1408: 1b7eb
1b80f b7ff kelbesque redux?	2032xp 1b81b lvl 1
	   purple flail soldier	(flail soldier stats)
	   green moth		(purple moth stats)
1b824 b814 dangerous invis mage (can be revealed to 'revealed mage' but not killed)
1b857 sabera redux?		2032xp: 1b863 lvl 1
1b887 b877 blue spider		200gp->500 1280xp->2032: 1b893
1b8c8 b8b8 madoh redux		2032xp atk 88->75 lvl 1
1b8f9 b8e9 black flail soldier	400gp->1000 1600xp->2032: 1b905
1b8af b89f skeleton		400gp->1000 1280xp->2032: 1b8bb paralysis immunity instead of poison: 1b8b2 8d->2d; 1b8b3 projectile type/graphic 57->52 slow bone/bone arrow
1b8e1 b8d1 purple beholder	400gp->1000 1440xp->2032: 1b8ed def 10->5 hp 128->80
1b940 b930 brown ooze		400gp->1000 1920xp->2032: 1b94c
1b929 b919 karmine		2032xp 1b935 lvl 1
1b912 b902 scorpion		200gp->500 1440xp->2032: 1b91e
1b9a1 b991 moon lion
1b9b8 b9a8 sun lion		projectile bb62
1b957 b947 mummy		400gp->1000 1760xp->2032: 1b963
1b989 b979 dragonian emperor	2032xp: 1b995 atk 120->90 projectile 1bb86 atk 120->90 lvl 1
1b970 b960 4-armed monks	400gp->1000 1920xp->2032: 1b97c atk 120->90 hp 180->120 def 14->8
1b9cf b9bf emperor true form	1bbc2 round projectile		1bbae poison projectile		1bb9a tracer fire	1bca7 nuper ring
	lvl 1	touch atk 128->100	round atk 100	poison atk 120	tracer atk 120->80
1ba16 ba06 120atk pink walker mech
1b9fd b9ed 100atk pink flyer?
1bdef bddf 63atk round rail shooter?
1ba46 ba36 99atk grey walker?
1ba5a ba4a dyna	pt 1 lvl 1	1ba72 dyna pt 2	lvl 1	1bc01 blue particle 120atk	1bbec laser 100atk	1bbd7 wave 100atk


11=A 19=I 29=Y 2a=Z? 2b=a 2c=b 2d=c 2e=d 2f=e 30=f 31=g 32=h 33=i 34=j 35=k 36=l 37=m 38=n 39=o 3a=p 3b=q 3c=r 3d=s 3e=t 3f=u 40=v 41=w 42=x 43=y 44=z 10=space fc=line break 0d=.
02b836		"You know, south of that town where all of the travelers stay, there's a cave..." -> 
		"You know, I think I saw an odd statue in the grass south of here..."
19 10 3e 32 33 38 35 10 19 fc 3d 2b 41 10 2b 38 10 39 2e 2e 10 3d 3e 2b 3e 3f 2f 10 33 38 10 3e 32 2f fc 31 3c 2b 3d 3d 10 3d 39 3f 3e 32 10 39 30 10 32 2f 3c 2f 0d 0d 0d fc ($10 x11)

43fd8/44d46:	"Sliding down is not the only thing you can do on the slopes at Mt. Sable."->
		"Forsake magic in order to use the Rabbit Boots."
16 39 3c 3d 2b 35 2f 10 37 2b 31 33 2d 10 33 38 fc 10 10 10 10 10 10 39 3c 2e 2f 3c 10 3e 39 10 3f 3d 2f 10 3e 32 2f fc 10 10 10 10 10 10 22 2b 2c 2c 33 3e 10 12 39 39 3e 3d 0d $10x32

change trigger for Tornel appearing at his house to obtaining gas mask. mask in slot 1 $6448:$29. tornel normally shows up with $64DE:$E0 (when you go into Ork village)
	godslayer:	
	f-c:07XXXX b:047XXX a:046XXX 9-8:02XXXX  7-0:cpu	477b3-7c00f; 37f45-3800f
	d801 07d811 4c3ed2 jmp $d23e (07d24e)
	jmp $b7b0;	pha;	lda #$E0;	sta $64de;	pla;	jmp $d23e
07d811:	4c b0b7;
0477c0:			48;	a9 e0; 		8d de64; 	68; 	4c 3ed2

	crystalis:
	f-c:03xxxx	b:02fXXX	a:02exxx	9-8:02xxxx	7-0:cpu		2fe38; 3fe3e
	d802	03d812		jmp $d23f (03d24f)	4c3fd2
	jmp $fe2e;	pha;	lda #$E0;	sta $64de;	pla;	jmp $d23f
03d812:	4c 2efe;
03fe3e:			48;	a9 e0; 		8d de64; 	68; 	4c 3fd2

reduce thunder lvl 3 flashing
	$3f00-3f1f palette RAM $3F00
	$3F00 Screen color	$3F01-$3F03 Background palette 0	$3F05-$3F07 Background palette 1	$3F09-$3F0B Background palette 2	$3F0D-$3F0F Background palette3 	$3F11-$3F13 Sprite palette 0	$3F15-$3F17 Sprite palette 1	$3F19-$3F1B Sprite palette 2	$3F1D-$3F1F Sprite palette 3
	palette data copied from $6140-615f to PPU $3fe0-3fff (mirror of 3f00-3f1f). ce6d/07ce7d handles flashing to white with no lightning;
	greenscreen flash ?; cecb/07cedb loads data from 98f0/001900-98ff & 99f0-99ff into 6140-615f -blue tint w/ gray sprites; 9af0-9aff & 9bf0-9bff black w/grey sprites;
	9cf0-9cff & 9df0-9dff black w/white sprites; 9ef0-9eff & 9ff0-9fff dimmer; a0f0-a0ff & a1f0-a1ff blue tint w/white sprites; a2f0-a2ff & a3f0-a3ff black w/white sprites;
	a4f0 & a5f0 tan (37) w/ black sp; a6f0 & a7f0 white w/black sp; a4f0 & a5f0; a6f0 & a7f0; a4 & a5 ; a6 & a7; a4 & a5; a6 & a7; a4 & a5; a6 & a7;
	a8 & a9 blue tint w/gray s; aa & ab black w/grey s; ac & ad dimmer; ae & af dimmer;
	ce21/07ce31 loads next color table position to use from ~cf46/07cf56 or d046 (a4/a6 in 07cf90-07d077 for tan/white flashing->a8)

stop 'out of magic' message when using spells
	MP stored/checked at $0708 when determining if enough MP to cast. a0a6 loads MP for Refresh, a15c stores $1c into $41 if OOM; 9aea loads for Paralyze, 9af7 stores $1c
	a196 loads for telepathy, a15c stores 1c; a1a4 loads for teleport, a15c for $1c; 9aea loads for Restore, 9af7 for 1c; a0fc loads for Barrier, a15c for 1c
	a172 loads Change, a15c for 1c; a127 loads Flight, a15c for 1c; a15c/03616c	9af7/35b07; 7cc2f changes $41 from $1c to $10->$08 to have buzz but no window
	spell selection stored into 642f@020316 then 0712@020346 w/stack 64,81,e3,d8,00,04,18,c9
	$4b stores new button presses; 036046 tests it for spellcast: lda 0043,Y (y is 0 for chaincast, 8 for single); y loaded from $a092,$10 ($0712 copy, spell #s 1-8)

Godslayer:
	f:07fXXX e:07eXXX d:07dXXX c:07cXXX b:037XXX a:036XXX 9:035XXX 8:034XXX
	jsr $38004;	lda $0720;	beq 3;		lda #$08; 	rts;		lda $a092,y;	rts	//if $0720 set, only check new button presses
36042:	20 f4 bf
38004:			ad 20 07	f0 03		a9 08		60;		b9 92 a0;	60

	jsr $37ff9;	lda #$01	sta $0720	lda #$1c	sta $41		rts			//if out of mana, set $0720
3616c:	20 e9 bf ea (nop)
37ff9:			a9 01		8d 20 07	a9 1c		85 41		60

	jsr $37fef;	jsr $a0b3	lda #$00	sta $0720	rts 					//on successful cast, clear $0720
360c0:	20 df bf		(refresh)
37fef:			20 b3 a0	a9 00		8d 20 07	60

	jsr $37fe4;	lda #$00	sta $0720	lda $08		and #$07	rts
36111:	20 d4 bf ea (nop)	(barrier)
37fe4:			a9 00		8d 20 07	a5 08		29 07		60

	jsr $37fd8;	lda #$00	sta $0720	lda #$34	sta $0460,X	rts
3613c:	20 c8 bf ea ea		(flight)
37fd8:			a9 00		8d 20 07	a9 34		9d 60 04	60


Crystalis: 3cc2f $10->$08
	jsr $3fe48;	lda $0720;	beq 3;		lda #$08; 	rts;		lda $a092,y;	rts	//if $0720 set, only check new button presses
36042:	20 38 fe
3fe48:			ad 20 07	f0 03		a9 08		60;		b9 92 a0;	60

	jsr $3fe54;	lda #$01	sta $0720	lda #$1c	sta $41		rts			//if out of mana, set $0720
3616c:	20 44 fe ea (nop)
3fe54:			a9 01		8d 20 07	a9 1c		85 41		60

	jsr $3fe5e;	jsr $a0b3	lda #$00	sta $0720	rts 					//on successful cast, clear $0720
360c0:	20 4e fe		(refresh)
3fe5e:			20 b3 a0	a9 00		8d 20 07	60

	jsr $3fe67;	lda #$00	sta $0720	lda $08		and #$07	rts
36111:	20 57 fe ea (nop)	(barrier)
3fe67:			a9 00		8d 20 07	a5 08		29 07		60

	jsr $3fe71;	lda #$00	sta $0720	lda #$34	sta $0460,X	rts
3613c:	20 61 fe ea ea		(flight)
3fe71:			a9 00		8d 20 07	a9 34		9d 60 04	60


fix screen shake during dialog
	break on write to $2000 (ppu_ctrl): @f8c9/07f8d9 y-scroll of 3 is correct, 4 is incorrect and causes 1-pixel vertical shift; FFFA-B NMI vector (on vblank): AA F3 (f3aa)
	$2005 is ppu_scroll (x then y); $2008-$3fff mirrors of PPU registers $2000-$2007; $2000 bits 0,1 control nametable: $0,$1 are enviro, $2,$3 are status screens
	y scroll becomes 3 or 4 before 7f3ba, start of interrupt code; ppu_scroll@7eb7f,7eb85, 7f4fd,7f561,7f4af
	f-c: 7yxxx	bxxx:37xxx	a:36xxx		9:35xxx	8:34xxx	7-0:RAM
loop cycles when 3: 29779-82. 	cycles when 4: 29778,29776. 1 frame in bad range shifts, 1-3 frames in good range fixes shift;
bcc taken= 3 cycles, lsr=5 cycles nop=2 cycles; lda ($80,x) a180=6 cycles; 2868d 46 09 tight loop waiting for NMI
steve_hacks patch: 07f465: ldx $07FE->ldx #$07, NOP; a207ea		7f4fb: NOP x5->ldx #$03, dex, bpl $f4ed (loops to previous instruction) a203ca10fd
god slayer 7f4eb/crystalis 3f4fb: a180 x2=shakier in gnes than x1, stable x0. nestopia more corruption but no wobble. fceux some corruption but fixes wobble. nintendulator good like stock. mednafen fixes wobble. punes good like stock. mesen good like stock.


switch orb/bracelet when switch sword
	$0711 is equipped sword: 0-5 (unequipped, wind sword, fire sword, water sword, bolt sword, god slayer)
	$6428 is equipped Sword slot#: 0-3 (OR #$80/$FF if unequipped)
	$0718 is equipped orb/bracelet: 0-8 (unequipped, wind orb, fire orb, water orb, bolt orb, tornado bracelet, flame bracelet, blizzard bracelet, bolt bracelet)
	$642b is equipped Power slot#: 0-3 (OR #$80/$FF if unequipped)
	$643c-f is contents of Power slots; 05:wind orb, 07:fire orb, 09:water orb, 0b:bolt orb, 06:tornado bracelet, 08:flame bracelet, 0a:blizzard bracelet, 0c:bolt bracelet
	07d9e7-07da1a code for checking Powers. returns Y value of power levels past 1, 07d90c stores in $0719
	(orbs)5 0101,7 0111,9 1001,b 1011	(bracelets)6 0110, 8 1000,a 1010,c 1100
Godslayer:	(y=$0711/sword#)
	cpy #$05; beq 07;	lda $643b,y; 	cmp #$FF;	bne $overRTS;	ldy #$00;	RTS;	and #$01;	bne $overRTS;	ldy #$02;	RTS;	ldy #$01;	RTS
07d9ec:	c0 05	  f0 07		b9 3b 64	c9 ff  		d0 03  		a0 00  		60	29 01		d0 03		a0 02		60	a0 01		60
Crystalis:
03d9ed:	"


dolphin riding condition corruption: 1fe9c contains garbage text 	1fe1c Normal	writes from cpu 603d-6045 to ppu 28d4 (first char of condition)
	1fe50 loads status value from $0710	1feb7 loads garbage data from be8c/1fe9c-1fea4	7d2ac stores status value into $0710 when on dolphin;
	7d2aa ORA #$40 status value for riding dolphin, bit 6. 01 is paralyzed 02 is petrified 03 is poisoned 04 is cursed;  1feac has 6 NOPs->AND #$7F (29 7F)
	1.03 changes 10 bytes at 1fe55	0a0a6d10070a60ffffff->8d1f070a0a6d1f070a60

lvl 3 sword attack when at exact MP to cast
	godslayer:
35cad:	jsr $37fd1	sbc #$01	cmp $0708	rts
	20 c1 bf
37fd1:			e9 01		cd 08 07	60

	crystalis:
35cad:	jsr $3fe7c	sbc #$01	cmp $0708	rts
	20 6c fe
3fe7c:			e9 01		cd 08 07	60